package cn.cnsuh.剑指offer.q22_链表中倒数第k个节点;

public class Main {
    /*

 Definition for singly-linked list.
 public class ListNode {
     int val;
     ListNode next;
     ListNode(int x) { val = x; }
 }

    class Solution {
        public ListNode getKthFromEnd(ListNode head, int k) {
            ListNode former = head , latter = head;
            for(int i = 0 ; i < k-1 ; i++){
                former = former.next;
            }
            while(former.next!=null){
                former = former.next;
                latter = latter.next;
            }
            return latter;
        }
    }
     */
}
